package com.yty.myadmin.config.mybatis;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@AutoConfigureAfter(MybatisConfigure.class)
public class MapperScannerConfigure {

    @Bean(name = "adminMapperScannerConfigure")
     public static MapperScannerConfigurer mapperScannerConfigurer(){
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setSqlSessionFactoryBeanName("adminSqlSessionFactory");
        mapperScannerConfigurer.setBasePackage("com.yty.myadmin.dao");
        return mapperScannerConfigurer;
    }
}
